package com.sq.partner.manager.dao.impl;

import java.sql.SQLException;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.sq.partner.manager.dao.IGatewayConfigDao;
import com.sq.partner.manager.mybatis.model.GatewayConfig;
@Repository
public class GatewayConfigDaoImpl extends BaseDaoImpl implements IGatewayConfigDao {

	@Override
	public List<GatewayConfig> getConfigList(GatewayConfig gatewayConfig) throws Exception{
		 List<GatewayConfig> list = this.queryList("queryGatewayConfigByMap", gatewayConfig);
		 
		 return  list;
	}

	@Override
	public GatewayConfig getConfigByName (String configName) throws Exception {
		return (GatewayConfig) this.query("queryGatewayConfigById", configName);
	}

	@Override
	public boolean addConfig(GatewayConfig gatewayConfig) throws Exception {
		return this.add("insertGatewayConfig", gatewayConfig);
	}

	@Override
	public boolean updateConfig(GatewayConfig gatewayConfig) throws Exception {
		return this.update("updateGatewayConfigNotNull", gatewayConfig);
	}

	@Override
	public boolean deleteConfig(String configName) throws Exception {
		return this.delete("delGatewayConfigById", configName);
	}

}
